#! /usr/bin/env python
# -*- coding:utf-8 -*-
#author:无涯

import  pytest
import  requests

@pytest.fixture()
def init(selenium):
	selenium.maximize_window()
	selenium.get('http://www.baidu.com')
	selenium.implicitly_wait(30)
	yield
	selenium.quit()


@pytest.fixture()
def login():
	r=requests.post(
		url='http://47.95.142.233:8000/login/auth/',
		json={"username":"13484545195","password":"asd888"})
	return r.json()['token']

@pytest.fixture()
def headers(login):
	return  {'Authorization':'JWT {token}'.format(token=login)}